<?php
//decode by http://奥森世纪/
namespace app\home\controller;

use think\Db;
use think\Log;
use think\Controller;

class Spread extends Controller {

	 function _initialize() {

			header('Access-Control-Allow-Origin: *');
			header('Access-Control-Allow-Methods:POST,GET,OPTIONS');
			header('Access-Control-Allow-Headers:x-requested-with,content-type,token');
	
		
	 }
    public function detail() {
    	
    		header('Access-Control-Allow-Origin: *');
			header('Access-Control-Allow-Methods:POST,GET,OPTIONS');
			header('Access-Control-Allow-Headers:x-requested-with,content-type,token');
			
        $task_id=request()->param('task_id');

        if(!$task_id){
            to_json(0, '', []);
        }

        $data=db('task')->find($task_id);
        if($data){
            to_json(1, '', $data);
        }else{
            to_json(0, '',[]);
        }
    }

}